#include "DataManager.h"

DataManager::DataManager(void)
{
}


DataManager::~DataManager(void)
{
}
const char* TABLE_TASK = "Task";
const char* TABLE_REWARDGROUP = "RewardGroup";
DataManager* DataManager::m_datamanager = NULL;
DataManager* DataManager::shareManager(){
	if(!m_datamanager){
		m_datamanager = new DataManager();
	}
	return m_datamanager;
}

void DataManager::initTaskData(CSJson::Value& data){
	TaskManager* taskMgr = TaskManager::shareTask();
	CSJson::Value taskTable = data[TABLE_TASK];
	taskMgr->initData(taskTable);
	CSJson::Value rewGroupTable = data[TABLE_REWARDGROUP];
	RewardGroupManager::shareManager()->initWordsData(rewGroupTable);
}
void DataManager::initRewardSampleData(CSJson::Value& data){
	RewardManager* manager = RewardManager::shareManager();
	manager->initData(data);
}